CC = gcc
CFLAGS = -Iinclude -Wall -Wextra -g
LDFLAGS = 

# 源文件和目标文件
SRCS = src/aodv_core.c src/route_table.c src/neighbor_table.c src/timer.c src/net_interface.c src/test_aodv.c
OBJS = $(SRCS:.c=.o)
TARGET = aodv_test

# 构建目标
all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)

# 编译规则
%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

# 清理规则
clean:
	rm -f $(OBJS) $(TARGET)
	rm -f *.exe
	rm -f *.o

# 运行测试
run: $(TARGET)
	./$(TARGET)

.PHONY: all clean run